{php include wl_template('common/header');}
<ul class="nav nav-tabs">
    <li class="active"><a href="javascript:;">满减活动</a></li>
</ul>
<div class="app-content">
    <div class="app-filter">
        <div class="filter-action">
            <a href="{php echo web_url('fullreduce/fullreduce/activeedit')}" class="btn btn-primary">添加活动</a>
        </div>
        <div class="filter-list">
            <form class="form-horizontal" action="{php echo web_url('fullreduce/fullreduce/activelist')}" method="post">
                <div class="form-group">
                    <div class="col-sm-2 control-label">活动标题</div>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" name="name" value="{$_GPC['name']}" placeholder="请输入活动标题">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-2 control-label"></div>
                    <div class="col-sm-9">
                        <button class="btn btn-primary" type="submit">搜索</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="app-table-list">
        {if !empty($lists)}
        <div class="table-responsive">
            <table class="table table-hover table-bordered">
                <thead>
                <tr>
                    <th class="text-center">活动ID</th>
                    <th class="text-center">活动名称</th>
                    <th class="text-center">活动规则</th>
                    <th class="text-center">创建时间</th>
                    <th class="text-center">状态</th>
                    <th class="text-center">排序</th>
                    <th class="text-center">操作</th>
                </tr>
                </thead>
                <tbody>
                {loop $lists $list}
                <tr class="text-center">
                    <td>{$list['id']}</td>
                    <td>{$list['title']}</td>
                    <td>
                        {loop $list['rules'] $ru}
                        满<span style="color: orangered;margin-left: 2px;margin-right:2px;">{$ru['full_money']}</span>元减<span style="color: darkorange;margin-left: 2px;margin-right:2px;">{$ru['cut_money']}</span>元</br>
                        {/loop}
                    </td>
                    <td>{$list['createtime']}</td>
                    <td>
                        <a data-toggle="ajaxPost" href="{php echo web_url('fullreduce/fullreduce/changeStatus', ['id' => $list['id'],'status'=>$list['status']])}" class='btn btn-sm {if $list['status']==1}btn-primary{else}btn-danger{/if}'>
                        {if $list['status']==1}启用{else}禁用{/if}
                        </a>
                    </td>
                    <td>{$list['sort']}</td>
                    <td>
                        <a class="btn btn-sm btn-primary" href="{php echo web_url('fullreduce/fullreduce/activeedit', array('id' => $list['id']))}">编辑</a>
                        <a class="btn btn-sm btn-danger" data-toggle="ajaxRemove" href="{php echo web_url('fullreduce/fullreduce/delete', array('id' => $list['id']))}" data-confirm="删除活动后所有选择此活动的商品满减活动都不会生效，确定删除?">删除</a>
                    </td>
                    {/loop}
                </tbody>
            </table>
        </div>
        {else}
        <div class="no-result">
            <p>还没有相关数据</p>
        </div>
        {/if}
    </div>
</div>


{php include wl_template('common/footer');}